﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Serietheque.Fenetres
{
    /// <summary>
    /// Logique d'interaction pour MissingEpisodes.xaml
    /// </summary>
    public partial class MissingEpisodes : Window
    {
        private IEnumerable<Episodes> missedepisodes;

        public IEnumerable<Episodes> Missedepisodes
        {
            get { return missedepisodes; }
            set { missedepisodes = value; }
        }

        public MissingEpisodes()
        {
            InitializeComponent();
        }

        public MissingEpisodes(IEnumerable<Episodes> missedepisodes)
        {
            InitializeComponent();
            this.DataContext = this;
            this.missedepisodes = missedepisodes;

            ListCollectionView cvTasks = new ListCollectionView(missedepisodes.ToList());
            //cvTasks.CanGroup = true;
            //cvTasks.CanSort = true;
            //cvTasks.GroupDescriptions.Clear();
            
            cvTasks.GroupDescriptions.Add(new PropertyGroupDescription("Saison.Serie"));
           // cvTasks.GroupDescriptions.Add(new PropertyGroupDescription("Saison"));

            DgMissedEpisodes.ItemsSource = cvTasks;
            
        }
    }
}
